﻿using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace ZOIL.DataModel
{
    public static class CollectionFactoryProvider
    {
        private static ICollectionFactory _factory;
        public static ICollectionFactory Factory
        {
            get { return _factory ?? (_factory = new DefaultCollectionFactory()); }
            set { _factory = value; }
        }
    }

    public sealed class DefaultCollectionFactory : ICollectionFactory
    {
        public IList<T> CreateList<T>()
        {
            return new List<T>();
        }

        public ObservableCollection<T> CreateObservableCollection<T>()
        {
            return new ObservableCollection<T>();
        }
    }
}
